[#import "/framework/JGP.htm"  as JGP]
<!--
项目   jgp-cloud-parent
作者   LOUFEI [Gavin]
时间   2018/11/15
-->
[@JGP.head "Title"/]
[@JGP.body]
    <jgp-div _row="['80','*']" _runit="px">
        <div slot="1-1">
            <jgp-btn _fn="submitFn">提交</jgp-btn>
        </div>
        <jgp-form _id="modelForm" slot="2-1" _action="/workflow/editorApiController/saveModel" _method="GET">
            <jgp-text _label="模型名称" _name="name" _col="12"></jgp-text>
            <jgp-drop _label="分类" _name="category" _url="/workflow/editorApiController/dropCategory" _col="12"></jgp-drop>
            <jgp-text _label="描述信息" _name="description" _col="12"></jgp-text>
            <jgp-hidden _name="systemId" _value="1"></jgp-hidden>
        </jgp-form>
    </jgp-div>

[/@JGP.body]

[@JGP.foot]
    <script>
        JGP.$onload(function () {
            var modelId = '${modelId!''}';
            if(modelId){
                JGP.$post('/workflow/editorApiController/queryModelById/'+modelId,{},function(result){
                    var modelForm=JGP.form('modelForm');
                    modelForm.setFdata(result.data.fdata);
                    modelForm.field('description',result.data.description)
                })
            }
        });
        function submitFn(){
            JGP.form('modelForm').ajaxSubmit(function (result) {
                JGP.$close(result.flag);
            });
        }
    </script>
[/@JGP.foot]